﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMusicList.DBModel;
using Tool;

namespace MyMusicList.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class AuditController : ApiController
    {
        private DataDBContext _context;
        BLL.User_Music User_Music = null;
        public AuditController(DataDBContext context)
        {
            _context = context;
        }

        /// <summary>
        /// 管理员审核，只对Is_Audited，Audited_Result，AuditedTime修改
        /// </summary>
        /// <param name="id"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        [HttpPut("{id}")]
        public object User_Music_Audit(int id, DBModel.User_Music value)
        {
            User_Music = new BLL.User_Music(_context);
            var data = User_Music.put(id, value);
            if (data.Equals(false))
            {
                return ResultArray(data);
            }
            return ResultArray(data);
        }
    }
}